<?php 
/**
 * 版本:酷享云支付3.0版
 * 作者：余生
 * 官网：www.kuxiangcms.com
 * 技术QQ：2316803263
 * 酷享云支付官网:pay.kuxiangcms.cn
**/
//接口配置
include "../includes/common.php";
include './head.php';
if ($islogin == 1) {
} else {
  exit("<script language='javascript'>window.location.href='./login.php';</script>");
}
?>

 <div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="">首页</a>
                <a>
                    <cite>接口配置</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
                <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
            </a>
        </div>
<?php 
if (isset($_POST['submit'])) {
	foreach ($_POST as $k => $value) {
		if ($k == 'pwd') {
			continue;
		}
		$value = daddslashes($value);
		$DB->query("insert into pay_config set `k`='{$k}',`v`='{$value}' on duplicate key update `v`='{$value}'");
	}
	 exit("<script language='javascript'>alert('修改成功！');window.location.href='./payset.php';</script>");
	exit;
}
?>
  <div class="layui-tab page-content-wrap layui-card">
      <ul class="layui-tab-title">
        <li class="layui-this">支付接口配置</li>
              
      </ul>
<div class="layui-tab page-content-wrap layui-card">
  <form action="" method="post" class="form-horizontal" role="form">

<br>
   <div class="layui-form-item">
              <label class="layui-form-label">支付宝配置：</label>
               <div class="layui-form-mid layui-word-aux">*支付相关接口配置</div>
            </div>
  <div class="layui-tab-content">
	  <label class="layui-form-label">对接接口:</label>
	  <div class="layui-input-block">
              <select  class="form-control" name="alipay_api" onchange="api_qh('ali',this.value)">
                  <option value="1" <?php echo $conf['alipay_api'] == 1 ? "selected" : "";?> >支付宝官方[PC+手机]</option>
									<option value="5" <?php echo $conf['alipay_api'] == 5 ? "selected" : "";?> >支付宝官方[当面付]</option>

                   <option value="2" <?php 
echo $conf['alipay_api'] == 2 ? "selected" : "";
?> >易支付</option>
                    <option value="3" <?php 
echo $conf['alipay_api'] == 3 ? "selected" : "";
?> >码支付</option>
                     <option value="4" <?php 
echo $conf['alipay_api'] == 4 ? "selected" : "";
?> >关闭维护</option>
              </select>
          </div>
	</div>
        
        <!--对接支付宝官方信息-->
        <div id="ali_gf_info" style="<?php 
echo $conf['alipay_api'] == 1 ? "" : "display: none;";
?>" >
	<div class="layui-tab-content">
	  <label class="layui-form-label">合作身份者id:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="ali_api_partner" value="<?php 
echo $conf['ali_api_partner'];
?>" class="layui-form-mid layui-word-aux"/>
              <small> * 合作身份者id，以2088开头的16位纯数字</small>
          </div>
	</div>
        <div class="layui-tab-content">
	  <label class="layui-form-label">收款支付宝账号:</label>
	  <div class="layui-input-block">
   <input type="text" class="layui-input" name="ali_api_seller_email" value="<?php 
echo $conf['ali_api_seller_email'];
?>" class="layui-form-mid layui-word-aux"/>
              <small> * 收款支付宝账号</small>
          </div>
	</div>
         <div class="layui-tab-content">
	  <label class="layui-form-label">安全检验码:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="ali_api_key" value="<?php 
echo $conf['ali_api_key'];
?>" class="layui-form-mid layui-word-aux"/>
              <small> * 安全检验码，以数字和字母组成的32位字符</small>
          </div>
	</div>
        </div>   
				<!-- END 对接支付宝官方信息-->
				
				<!--对接支付宝官方信息-->
				        <div id="ali_gf_info2" style="<?php 
				echo $conf['alipay_api'] == 5 ? "" : "display: none;";
				?>" >
					<div class="layui-tab-content">
					  <label class="layui-form-label">APPID:</label>
					  <div class="layui-input-block">
				              <input type="text" class="layui-input" name="ali_app_id" value="<?php 
				echo $conf['ali_app_id'];
				?>" class="layui-form-mid layui-word-aux"/>
				              <small> * 支付宝开放平台获取 https://openhome.alipay.com/platform/appManage.htm</small>
				          </div>
					</div><br/>
				        <div class="layui-tab-content">
					  <label class="layui-form-label">支付宝公钥:</label>
					  <div class="layui-input-block">
				              <input type="text" class="layui-input" name="ali_public_key" value="<?php 
				echo $conf['ali_public_key'];
				?>" class="layui-form-mid layui-word-aux"/>
				              <small> * 支付宝公钥</small>
				          </div>
					</div><br/>
				         <div class="layui-tab-content">
					  <label class="layui-form-label">商户私钥:</label>
					  <div class="layui-input-block">
				              <input type="text" class="layui-input" name="ali_merchant_private_key" value="<?php 
				echo $conf['ali_merchant_private_key'];
				?>" class="layui-form-mid layui-word-aux"/>
				              <small> * 商户私钥</small>
				          </div>
					</div><br/>
				        </div>   
								<!-- END 对接支付宝官方信息-->
        
         <!--对接易支付信息-->
         <div id="ali_epay_info" style="<?php 
echo $conf['alipay_api'] == 2 ? "" : "display: none;";
?>">
	<div class="layui-tab-content">
	  <label class="layui-form-label">易支付地址:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="ali_epay_api_url" value="<?php 
echo $conf['ali_epay_api_url'];
?>" class="layui-form-mid layui-word-aux"/>
              <small> * 网站的URL地址 例如:http://pay.zxzxz.wang/</small>
          </div>
	</div><br/>
        <div class="layui-tab-content">
	  <label class="layui-form-label">易支付ID:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="ali_epay_api_id" value="<?php 
echo $conf['ali_epay_api_id'];
?>" class="layui-form-mid layui-word-aux"/>
              <small> * 易支付商户ID</small>
          </div>
	</div><br/>
         <div class="layui-tab-content">
	  <label class="layui-form-label">易支付KEY:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="ali_epay_api_key" value="<?php 
echo $conf['ali_epay_api_key'];
?>" class="layui-form-mid layui-word-aux"/>
              <small> * 易支付商户密钥(KEY)，以数字和字母组成的32位字符</small>
          </div>
	</div><br/>
        </div>   <!-- END 对接易支付信息-->
        
         <!--对接码支付信息-->
         <div id="ali_codepay_info" style="<?php 
echo $conf['alipay_api'] == 3 ? "" : "display: none;";
?>">
	
        <div class="layui-tab-content">
	  <label class="layui-form-label">码支付ID:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="ali_codepay_api_id" value="<?php 
echo $conf['ali_codepay_api_id'];
?>" class="layui-form-mid layui-word-aux"/>
              <small> * 码支付商户ID</small>
          </div>
	</div><br/>
         <div class="layui-tab-content">
	  <label class="layui-form-label">码支付KEY:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="ali_codepay_api_key" value="<?php 
echo $conf['ali_codepay_api_key'];
?>" class="layui-form-mid layui-word-aux"/>
              <small> * 码支付通信密钥(KEY)，以数字和字母组成的32位字符</small>
          </div>
	</div><br/>
        </div>   <!-- END 对接码支付信息-->
        
         <!--关闭通道维护信息-->
         <div id="ali_close_info" style="<?php 
echo $conf['alipay_api'] == 4 ? "" : "display: none;";
?>">
	
      
         <div class="layui-tab-content">
	  <label class="layui-form-label">维护提示:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="ali_close_info" value="<?php 
echo $conf['ali_close_info'];
?>" class="layui-form-mid layui-word-aux"/>
              <small> * 维护通知</small>
          </div>
	</div><br/>
        </div>   <!-- END 关闭通道维护信息-->
         <div class="layui-form-item">
              <div class="layui-input-block">
              <input type="submit" name="submit" value="保存修改" class="layui-btn layui-btn-normal layui-btn-sm"/>
              </div>
            </div>   
  </form>
  
</div>
</div></div>
        
    <div class="layui-tab page-content-wrap layui-card">
  <form action="" method="post" class="form-horizontal" role="form">
<br>
   <div class="layui-form-item">
              <label class="layui-form-label">微信配置：</label>
               <div class="layui-form-mid layui-word-aux">*微信相关接口配置</div>
            </div>
           <div class="layui-tab-content">
	  <label class="layui-form-label">对接接口:</label>
	  <div class="layui-input-block">
              <select  class="form-control" name="wxpay_api" onchange="api_qh('wx',this.value)">
                  <option value="1" <?php 
echo $conf['wxpay_api'] == 1 ? "selected" : "";
?> >微信官方</option>
                  <option value="2" <?php 
echo $conf['wxpay_api'] == 2 ? "selected" : "";
?> >易支付</option>
                  <option value="3" <?php 
echo $conf['wxpay_api'] == 3 ? "selected" : "";
?> >码支付</option>
                  <option value="4" <?php 
echo $conf['wxpay_api'] == 4 ? "selected" : "";
?> >关闭维护</option>
              </select>
          </div>
	</div>
        
        <!--对接微信官方信息-->
        <div id="wx_gf_info" style="<?php 
echo $conf['wxpay_api'] == 1 ? "" : "display: none;";
?>" >
	<div class="layui-tab-content">
	  <label class="layui-form-label">APPID:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="wx_api_appid" value="<?php 
echo $conf['wx_api_appid'];
?>" class="form-control"/>
              <small> * 绑定支付的APPID（必须配置，开户邮件中可查看）</small>
          </div>
	</div><br/>
        <div class="layui-tab-content">
	  <label class="layui-form-label">MCHID:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="wx_api_mchid" value="<?php 
echo $conf['wx_api_mchid'];
?>" class="form-control"/>
              <small> * 商户号（必须配置，开户邮件中可查看）</small>
          </div>
	</div><br/>
         <div class="layui-tab-content">
	  <label class="layui-form-label">商户支付密钥:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="wx_api_key" value="<?php 
echo $conf['wx_api_key'];
?>" class="form-control"/>
              <small> * 商户支付密钥，参考开户邮件设置（必须配置，登录商户平台自行设置） <br>设置地址：https://pay.weixin.qq.com/index.php/account/api_cert</small>
          </div>
	</div><br/>
     
          <div class="layui-tab-content">
	  <label class="layui-form-label">APPSECRET:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="wx_api_appsecret" value="<?php 
echo $conf['wx_api_appsecret'];
?>" class="form-control"/>
              <small> * 公众帐号secert（仅JSAPI支付的时候需要配置， 登录公众平台，进入开发者中心可设置）<br>获取地址：https://mp.weixin.qq.com/advanced/advanced?action=dev&t=advanced/dev&token=2005451881&lang=zh_CN</small>
          </div>
	</div><br/>
        </div>      
        <!-- END 对接支付宝官方信息-->
        
         <!--对接易支付信息-->
         <div id="wx_epay_info" style="<?php 
echo $conf['wxpay_api'] == 2 ? "" : "display: none;";
?>">
	<div class="layui-tab-content">
	  <label class="layui-form-label">易支付地址:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="wx_epay_api_url" value="<?php 
echo $conf['wx_epay_api_url'];
?>" class="form-control"/>
              <small> * 网站的URL地址 例如:https://pay.kuxiangcms.cn/或http://域名/</small>
          </div>
	</div><br/>
        <div class="layui-tab-content">
	  <label class="layui-form-label">易支付ID:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="wx_epay_api_id" value="<?php 
echo $conf['wx_epay_api_id'];
?>" class="form-control"/>
              <small> * 易支付商户ID</small>
          </div>
	</div><br/>
         <div class="layui-tab-content">
	  <label class="layui-form-label">易支付KEY:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="wx_epay_api_key" value="<?php 
echo $conf['wx_epay_api_key'];
?>" class="form-control"/>
              <small> * 易支付商户密钥(KEY)，以数字和字母组成的32位字符</small>
          </div>
	</div><br/>
        </div>   <!-- END 对接易支付信息-->
        
         <!--对接码支付信息-->
         <div id="wx_codepay_info" style="<?php 
echo $conf['wxpay_api'] == 3 ? "" : "display: none;";
?>">
	
        <div class="layui-tab-content">
	  <label class="layui-form-label">码支付ID:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="wx_codepay_api_id" value="<?php 
echo $conf['wx_codepay_api_id'];
?>" class="form-control"/>
              <small> * 码支付商户ID</small>
          </div>
	</div><br/>
         <div class="layui-tab-content">
	  <label class="layui-form-label">码支付KEY:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="wx_codepay_api_key" value="<?php 
echo $conf['wx_codepay_api_key'];
?>" class="form-control"/>
              <small> * 码支付通信密钥(KEY)，以数字和字母组成的32位字符</small>
          </div>
	</div><br/>
        </div>   <!-- END 对接码支付信息-->
        
        <!--关闭通道维护信息-->
         <div id="wx_close_info" style="<?php 
echo $conf['wxpay_api'] == 4 ? "" : "display: none;";
?>">
	
      
         <div class="layui-tab-content">
	  <label class="layui-form-label">维护提示:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="wx_close_info" value="<?php 
echo $conf['wx_close_info'];
?>" class="form-control"/>
              <small> * 维护通知</small>
          </div>
	</div><br/>
        </div>   <!-- END 关闭通道维护信息-->
        
	<div class="layui-form-item">
              <div class="layui-input-block">
              <input type="submit" name="submit" value="保存修改" class="layui-btn layui-btn-normal layui-btn-sm"/>
              </div>
            </div>  
      
  </form>
  
</div>
        
        <div class="layui-tab page-content-wrap layui-card">
  <form action="" method="post" class="form-horizontal" role="form">
<br>
   <div class="layui-form-item">
              <label class="layui-form-label">QQ配置：</label>
               <div class="layui-form-mid layui-word-aux">*QQ相关接口配置</div>
            </div>
           <div class="layui-tab-content">
	  <label class="layui-form-label">对接接口:</label>
	  <div class="layui-input-block">
              <select  class="form-control" name="qqpay_api" onchange="api_qh('qq',this.value)">
                  <option value="1" <?php 
echo $conf['qqpay_api'] == 1 ? "selected" : "";
?> >QQ官方</option>
                  <option value="2" <?php 
echo $conf['qqpay_api'] == 2 ? "selected" : "";
?> >易支付</option>
                  <option value="3" <?php 
echo $conf['qqpay_api'] == 3 ? "selected" : "";
?> >码支付</option>
                  <option value="4" <?php 
echo $conf['qqpay_api'] == 4 ? "selected" : "";
?> >关闭维护</option>
              </select>
          </div>
	</div><br/>
        
        <!--对接QQ官方信息-->
        <div id="qq_gf_info" style="<?php 
echo $conf['qqpay_api'] == 1 ? "" : "display: none;";
?>" >
	<div class="layui-tab-content">
	  <label class="layui-form-label">MCH_ID:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="qq_api_mchid" value="<?php 
echo $conf['qq_api_mchid'];
?>" class="form-control"/>
              <small> * QQ钱包商户号</small>
          </div>
	</div><br/>
        <div class="layui-tab-content">
	  <label class="layui-form-label">MCH_KEY:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="qq_api_mchkey" value="<?php 
echo $conf['qq_api_mchkey'];
?>" class="form-control"/>
              <small> * QQ钱包商户平台(http://qpay.qq.com/)获取</small>
          </div>
	</div><br/>
        </div>      
        <!-- END 对接QQ官方信息-->
        
         <!--对接易支付信息-->
         <div id="qq_epay_info" style="<?php 
echo $conf['qqpay_api'] == 2 ? "" : "display: none;";
?>">
	<div class="layui-tab-content">
	  <label class="layui-form-label">易支付地址:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="qq_epay_api_url" value="<?php 
echo $conf['qq_epay_api_url'];
?>" class="form-control"/>
              <small> * 网站的URL地址 例如:https://pay.kuxiangcms.cn/或http://域名</small>
          </div>
	</div><br/>
        <div class="layui-tab-content">
	  <label class="layui-form-label">易支付ID:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="qq_epay_api_id" value="<?php 
echo $conf['qq_epay_api_id'];
?>" class="form-control"/>
              <small> * 易支付商户ID</small>
          </div>
	</div><br/>
         <div class="layui-tab-content">
	  <label class="layui-form-label">易支付KEY:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="qq_epay_api_key" value="<?php 
echo $conf['qq_epay_api_key'];
?>" class="form-control"/>
              <small> * 易支付商户密钥(KEY)，以数字和字母组成的32位字符</small>
          </div>
	</div><br/>
        </div>   <!-- END 对接易支付信息-->
        
         <!--对接码支付信息-->
         <div id="qq_codepay_info" style="<?php 
echo $conf['qqpay_api'] == 3 ? "" : "display: none;";
?>">
	
        <div class="layui-tab-content">
	  <label class="layui-form-label">码支付ID:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="qq_codepay_api_id" value="<?php 
echo $conf['qq_codepay_api_id'];
?>" class="form-control"/>
              <small> * 码支付商户ID</small>
          </div>
	</div><br/>
         <div class="layui-tab-content">
	  <label class="layui-form-label">码支付KEY:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="qq_codepay_api_key" value="<?php 
echo $conf['qq_codepay_api_key'];
?>" class="form-control"/>
              <small> * 码支付通信密钥(KEY)，以数字和字母组成的32位字符</small>
          </div>
	</div><br/>
        </div>   <!-- END 对接码支付信息-->
        
        <!--关闭通道维护信息-->
         <div id="qq_close_info" style="<?php 
echo $conf['qqpay_api'] == 4 ? "" : "display: none;";
?>">
	
      
         <div class="layui-tab-content">
	  <label class="layui-form-label">维护提示:</label>
	  <div class="layui-input-block">
              <input type="text" class="layui-input" name="qq_close_info" value="<?php 
echo $conf['qq_close_info'];
?>" class="form-control"/>
              <small> * 维护通知</small>
          </div>
	</div><br/>
        </div>   <!-- END 关闭通道维护信息-->
        
	<div class="layui-form-item">
              <div class="layui-input-block">
              <input type="submit" name="submit" value="保存修改" class="layui-btn layui-btn-normal layui-btn-sm"/>
              </div>
            </div>  
      
  </form>
  
</div>
</div></div>

    </div>
  </div>
<script>
function api_qh(type,val){
    var alipay  = $("#"+type+"_gf_info");
		var alipay2  = $("#"+type+"_gf_info2");
    var epay =  $("#"+type+"_epay_info");
    var codepay =  $("#"+type+"_codepay_info");
    var cloes = $("#"+type+"_close_info");
    if(val == 1){
       $(alipay).show()
			 $(alipay2).hide()
       $(epay).hide();
       $(codepay).hide();
       $(cloes).hide();
       
    }
    if(val == 2){
       $(alipay).hide()
			 $(alipay2).hide()
       $(epay).show();
       $(codepay).hide();
       $(cloes).hide();
    }
    if(val == 3){
       $(alipay).hide()
			 $(alipay2).hide()
       $(epay).hide();
       $(codepay).show();
       $(cloes).hide();
    }
      if(val == 4){
       $(alipay).hide()
       $(alipay2).hide()
       $(epay).hide();
       $(codepay).hide();
       $(cloes).show();
    }
			if(val == 5){
			$(alipay).hide()
			$(alipay2).show()
			$(epay).hide();
			$(codepay).hide();
			$(cloes).hide();
		}
}
    
</script>

<!--请勿盗卖酷享云支付源码程序 ，如发现盗卖将不提供更新服务，系统由余生网络信息提供技术服务-->
<script>
//Demo
layui.use('form', function(){
  var form = layui.form;
  

});
</script>